#include <REGX52.H>
#include "Delay.h"

sbit LED = P2^0;

void Time(unsigned time);

void main() {
	
	unsigned char time,i;
	
	while (1) {
		
		for(time = 0; time < 100; time++) {
			for(i = 0; i < 20; i++) {
				LED = 0;
				Time(time);
				LED = 1;
				Time(100 - time);
			}
		}
		for(time = 100; time > 0; time--) {
			for(i = 0; i < 20; i++) {
				LED = 0;
				Time(time);
				LED = 1;
				Time(100 - time);
			}
		}
		
	}
	
}

void Time(int time) {
	while(time --);
}